var S = Object.defineProperty, h = Object.defineProperties;
var m = Object.getOwnPropertyDescriptors;
var c = Object.getOwnPropertySymbols;
var x = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
var l = (e, o, s) => o in e ? S(e, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[o] = s, p = (e, o) => {
  for (var s in o || (o = {}))
    x.call(o, s) && l(e, s, o[s]);
  if (c)
    for (var s of c(o))
      C.call(o, s) && l(e, s, o[s]);
  return e;
}, f = (e, o) => h(e, m(o));
import { computed as i } from "vue";
import { c as D } from "../component-87e22bdd.mjs";
import { c as k } from "../props-c0e5b20d.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
const F = f(p({}, k), {
  price: {
    type: [Number, String],
    default: 0
  },
  needSymbol: {
    type: Boolean,
    default: !0
  },
  symbol: {
    type: String,
    default: "&yen;"
  },
  decimalDigits: {
    type: Number,
    default: 2
  },
  thousands: {
    type: Boolean,
    default: !1
  },
  position: {
    type: String,
    default: "before"
  },
  size: {
    type: String,
    default: "normal"
  },
  strikeThrough: {
    type: Boolean,
    default: !1
  }
}), { create: T, useVinContext: $, componentName: u } = D("price"), V = T({
  props: F,
  setup(e) {
    const { getMainClass: o, getMainStyle: s } = $(e), g = i(
      () => o({
        [`${u}--strike`]: e.strikeThrough
      })
    ), y = i(s), n = (t) => (t = t.replace(/&quot;/g, '"'), t = t.replace(/&amp;/g, "&"), t = t.replace(/&lt;/g, "<"), t = t.replace(/&gt;/g, ">"), t = t.replace(/&nbsp;/g, " "), t = t.replace(/&yen;/g, "￥"), t), d = i(() => e.needSymbol ? n(e.symbol) : ""), r = (t) => String(t).indexOf(".") > 0;
    return {
      mainClass: g,
      mainStyle: y,
      symbolChar: d,
      checkPoint: r,
      formatThousands: (t) => (Number(t) === 0 && (t = 0), r(t) ? (t = Number(t).toFixed(e.decimalDigits), t = typeof t.split(".") == "string" ? t.split(".") : t.split(".")[0]) : t = t.toString(), e.thousands ? (t || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : t),
      formatDecimal: (t) => {
        Number(t) === 0 && (t = 0), r(t) ? (t = Number(t).toFixed(e.decimalDigits), t = typeof t.split(".") == "string" ? 0 : t.split(".")[1] ? t.split(".")[1] : 0) : t = 0;
        const b = `0.${t}`, a = Number(b).toFixed(e.decimalDigits);
        return String(a).substring(2, a.length);
      },
      replaceSpecialChar: n
    };
  }
});
export {
  V as default
};
